<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="/css/style.css">
</head>
<body>
    <h3>笔记列表页 
        <% if(username){%>
            <a href="/addnote">添加笔记</a>
            <a href="/center">个人中心</a>
            <a href="/logout">退出</a>
        <%}else{%>
            <a href="/register">注册</a>
            <a href="/login">登录</a>
        <%}%>
    </h3>
    
    <ul>
        <% data.forEach(item=>{%>
            <li>
                <h4><%=item.title%></h4>
                <p>
                    <a href="/updatenote?_id=<%=item._id%>">编辑</a>
                    <a href="/delnote/<%=item._id%>">删除</a>
                </p>
                <p class="time"><%=item.createtime%></p>
            </li>
        <%})%>
    </ul>
</body>
</html>